package com.blogspot.aurelije.entity;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;

@Data
@EqualsAndHashCode(exclude={"id", "club", "competitorCategory"})
@RequiredArgsConstructor
@NoArgsConstructor
@Entity
public class Competitor implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 6827458174761702124L;

	@Id
	@GeneratedValue
	private Long id;
	@NonNull
	private String firstName;
	@NonNull
	private String lastName;
	@NonNull
	private Integer registrationNumber;
	@NonNull
	private Integer generation;
	@NonNull
	private Integer registrationYear;
	@ManyToOne
	private Club club;
	@ManyToOne
	private CompetitorCategory competitorCategory;
	public static void main(String args[]){
		new Competitor();
	}
}
